﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Entity.Migrations;
using PortfolioApp.DataModels;

namespace PortfolioApp.Data.Migrations
{
    public class Seeder
    {
        public static void Seed(ApplicationDbContext db, bool seedPosts = true, bool seedProjects = true)
        {
            if (seedPosts)
            {
                db.Posts.AddOrUpdate(
                    x => x.Content,
                    new Post() { Title = "This is my first blog post", Content = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sed fermentum purus. Sed egestas et mi a ornare. Morbi aliquet ex nec neque mollis vulputate. Phasellus quis massa quis ante ullamcorper semper eu nec turpis. Nulla ultrices ex quis felis finibus maximus ut eu felis. Nam iaculis libero eget posuere laoreet." },
                    new Post() { Title = "The second blog post", Content = "Praesent efficitur lectus eget mollis faucibus. Etiam in dui a nisl scelerisque varius. Ut feugiat sodales lectus, consequat imperdiet risus euismod a. Nullam vehicula, est eu iaculis ultricies, justo ex vehicula ipsum, vitae bibendum nisl elit id quam." },
                    new Post() { Title = "Third Times a Charm", Content = "Pellentesque ac turpis dictum, finibus tortor aliquet, bibendum dui. Aliquam hendrerit aliquam odio, ut cursus elit ullamcorper sed." },
                    new Post() { Title = "Four in a row", Content = "Praesent tempus vulputate aliquam. Suspendisse eget lacinia quam, in venenatis turpis. In hac habitasse platea dictumst." }
                    );
            }
            if (seedProjects)
            {
                db.Projects.AddOrUpdate(
                    x => x.Name,
                    new Project() { Name = "Art Gallery App", Description = "SPA - Art Gallery App using Angular, WebApi, and MVC. List of Art Pieces and Authentication. Only owner can modify an art piece. Only logged in users can add art. public can only see art.", CodeplexLink = "https://jyiartgalleryapp.codeplex.com/SourceControl/latest", Image = "http://icons.iconarchive.com/icons/tpdkdesign.net/refresh-cl/256/System-Box-Empty-icon.png" },
                    new Project() { Name = "College Review App", Description = "College Review App using WebAPI and Angular. List of Colleges and Detail View", CodeplexLink = "https://jyicollegereviewapp.codeplex.com/SourceControl/latest", Image = "http://icons.iconarchive.com/icons/tpdkdesign.net/refresh-cl/256/System-Box-Empty-icon.png" },
                    new Project() { Name = "TV Show App", Description = "List Of TV Shows with Characters", CodeplexLink = "https://gojoshyihomework.codeplex.com/SourceControl/latest", Image = "http://icons.iconarchive.com/icons/tpdkdesign.net/refresh-cl/256/System-Box-Empty-icon.png" },
                    new Project() { Name = "Movie Review App", Description = "List of Movies with Reviews and Ratings.", CodeplexLink = "https://gojoshyihomework.codeplex.com/SourceControl/latest", Image = "http://icons.iconarchive.com/icons/tpdkdesign.net/refresh-cl/256/System-Box-Empty-icon.png" },
                    new Project() { Name = "Comic Book App", Description = "Comic Book App - List of Comic Books, Authors, and Characters. Practicing the many to many relationships and using the intermediary table to tie the connections within the database.", CodeplexLink = "https://gojoshyihomework.codeplex.com/SourceControl/latest", Image = "http://icons.iconarchive.com/icons/tpdkdesign.net/refresh-cl/256/System-Box-Empty-icon.png" }
                    );
            }
        }
    }
}
